<template>
  <van-pull-refresh  class="app-container" v-model="loading" @refresh="onRefresh">
    <p>刷新次数: {{ count }}</p>
  </van-pull-refresh>
</template>

<script>
export default {
  name: 'Home',
  components: {},
  data() {
    return {
      loading: false,
      count: 0
    }
  },
  methods: {
    onRefresh() {
      this.loading = true
      setTimeout(() => {
        this.count++
        this.loading = false
      }, 2000)
    }
  }
}
</script>

<style lang="less" scoped>
.title {
  font-size: 1.2rem;
  font-weight: bold;
}
</style>
